import { computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'
export function useRouteAndRouter() {
  const route = useRoute()
  const router = useRouter()

  // 获取当前是否为风险筛查的界面
  // 响应式
  const riskRouters = [
    'waitingRiskScreening',
    'riskScreening',
    'riskWithScreening',
    'riskWithMedicalRecord',
    'riskWithAssessment',
  ]
  const isRiskRx = computed(() => {
    if (riskRouters.includes(route.name)) {
      return true
    }
    return false
  })

  function isRisk() {
    if (riskRouters.includes(route.name)) {
      return true
    }
    return false
  }

  const isEmrViewRx = computed(() => {
    if (route.name === 'screening') {
      return true
    }
    return false
  })

  function isEmrView() {
    if (route.name === 'screening') {
      return true
    }
    return false
  }
  function isPatientInfoRx() {
    return computed(() => {
      if (route.name === 'patientInfo') {
        return true
      }
      return false
    })
  }

  function isPatientInfo() {
    if (route.name === 'patientInfo') {
      return true
    }
    return false
  }
  return {
    isRiskRx,
    isRisk,
    isPatientInfoRx,
    isPatientInfo,
    isEmrViewRx,
    isEmrView,
  }
}
